
const { getCode } = require('./code/utils')
const router = require('./router/user/user.js')
const bodyParser = require("body-parser");
const express = require('express')
const app = express()

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use('/api', router)
app.use(function (req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    res.send(getCode({}, '未找到接口', 404))
    next(err);
});

app.listen(3000, () => {
    console.log("http:/127.0.0.1:3000")
})